package org.bing.engine.console.service;

import java.util.List;

import org.bing.engine.core.domain.Balancer;
import org.bing.engine.core.domain.BalancerSetting;

public class BalancerSettingManager extends AbstractHibernateManager {

    public BalancerSetting save(BalancerSetting setting) {
        template.saveOrUpdate(setting);
        return setting;
    }

    @SuppressWarnings("unchecked")
    public List<BalancerSetting> findAll() {
        return template.find("select t from BalancerSetting t");
    }

    @SuppressWarnings("unchecked")
    public List<BalancerSetting> findByBalancer(Balancer b) {
        return template.find("select t from BalancerSetting t where t.balancer=?", b);
    }
}
